<?php
class Pageley_Query_Condition_AndGroup extends Pageley_Query_Condition_Aggregate {
	
	public function __construct($conditions) {
		parent::__construct($conditions);
	}
	
	public function matches($entity) {
		$matches = true;
		foreach($this->getConditions() as $condition) {
			if(!$condition->matches($entity)) {
				$matches = false;
				break;
			}
		}
		return $matches;
	}
	
	public function getOperator() {
		return "and";
	}
}